<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp" %>
<%@include file="/WEB-INF/page/layouts/other.jsp"%>
<div id="header" >
		<div id="headerCenter"  class="bodyCenter">
			<div class="header_Item header_logo">
			<%-- 
			<a href="${ctx }/">
				<img alt="调问网" src="${ctx }/images/logo/LOGO.png" >
			</a> 
			--%>
				<span style="font-family: '微软雅黑';font-size:26px;padding-left:10px;">信息收集系统</span>
			</div>
<%--	游客模式，首页时的header--%>
			<shiro:guest>
				<div class="header_Item header_menu">

				</div>
				<div class="header_Item header_user" style="float: right;">
<%--					添加注册页面--%>

<%--						<a href="${ctx}/reg/user-reg!input.action"  class="btn-a-1">新用户注册</a>--%>

					<c:choose>
						<c:when test="${act eq '1'}">
							<a href="${ctx }/login.jsp"  class="btn-a-1">返回</a>
						</c:when>

						<c:otherwise>
							<a href="${ctx }/reg/user-reg!input.action"  class="btn-a-1">新用户注册</a>
						</c:otherwise>
					</c:choose>


				</div>
			</shiro:guest>
<%--			登陆之后，的header--%>
			<shiro:user>
				<div class="header_Item header_menu">
					<ul>
					<%-- <li><a href="${ctx }/" >首页</a></li> --%>
					<li><a href="${ctx }/design/my-survey.action" id="mysurvey">问卷</a></li>
<%--						管理员权限--%>
						<shiro:hasRole name="admin" >
									<li><a href="${ctx }/sy/user/user-admin.action" id="usermanager">用户</a></li>
									<li><a href="${ctx }/sy/system/sys-property!input.action" id="systemset">设置</a></li>
						</shiro:hasRole>
									<li><a href="">预留页</a></li>
									</ul>
								</div>
								<div class="header_Item header_user" style="float: right;margin-top: 12px;position: relative;zoom: 1;z-index: 165;">
									<a href="#" class="clickHideUserMenu">
										<span class="head_use_name">

						<shiro:principal>

						</shiro:principal>
						</span>
						<span class="header_user_icon">&nbsp;</span>
					</a>
					<div class="a-w-sel a-w-sel-head" style="">
		            	<div class="w-sel" style="margin-top: 16px;">
		                	<div class="selc">
		                    	<div class="selcc tbtag">
		                            <div class="seli">
										<a class="nx-1" href="${ctx }/ic/user!myaccount.action">修改</a>
									</div>
		                            <div class="seli">
										<a class="nx-7 disUser_a" href="${ctx }/ic/user!delete.action">注销</a>
									</div>
		                            <div class="seli">
										<a class="nx-8 logout" href="${ctx }/login!logout.action">退出</a>
									</div>
		                        </div>
		                    </div>
		                </div>
		            </div>
				</div>
			</shiro:user>
		</div>
		<div style="clear: both;"></div>
	</div>
<script type="text/javascript">
	$(".disUser_a").click(function(){
		var thVal=$(this).text();
		var th=$(this);
		if(confirm("确定要注销当前账户吗？")){
			var url=$(this).attr("href");
			var data="";
			$.ajax({
				url:url,
				data:data,
				type:'post',
				success:function(msg){
					window.location.href = "${ctx }/ic/user!delete.action";
				}
			});
		}
		return false;
	});
</script>

<script type="text/javascript">
	$(".logout").click(function(){
		var thVal=$(this).text();
		var th=$(this);
		if(confirm("确定要退出系统吗？")){
			var url=$(this).attr("href");
			var data="";
			$.ajax({
				url:url,
				data:data,
				type:'post',
				success:function(msg){
					window.location.href = "${ctx }/login!logout.action";
				}
			});
		}
		return false;
	});
</script>